# -*- coding:utf-8 -*-
"""
Author：Administrator
Date:2021年12月13日
"""
import pandas as pd
import matplotlib.pyplot as plt

df1 = pd.read_excel('../source/data - 5.6.1.xls')
# 多折线图
x1 = df1['姓名']
y1 = df1['语文']
y2 = df1['数学']
y3 = df1['英语']
plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['xtick.direction'] = 'out'  # x轴刻度线向外显示
plt.rcParams['ytick.direction'] = 'in'
plt.title('语数外成绩大比拼', fontsize=18)
plt.plot(x1, y1, label='语文', color='r', marker='p')
plt.plot(x1, y2, label='数学', color='g', marker='.', mfc='r', ms=8, alpha=0.7)
plt.plot(x1, y3, label='英语', color='b', linestyle='-.', marker='*')
plt.grid(axis='y')  # 显示网格y轴
plt.ylabel('分数')
plt.xlabel('学生姓名')
plt.yticks(range(50, 150, 10))
plt.legend(['语文', '数学', '英语'])
plt.savefig('../source/image.png')
plt.show()
